<?php
// Module Definition
$module['name'] = 'Mod CBand';
$module['description'] = 'Provide bandwidth and transfer monitoring and limitations.';
$module['depends'] = Array('apache');

switch($action) {
	case 'register':
		break;
	case 'unregister':
		break;
	case 'enable':
		break;
	case 'disable':
		break;
	case 'hook':
		register_hook('web:server:newaccount:table', 'mod_cband_reseller_settings');
		
		register_hook('web:reseller:resellerset:table', 'mod_cband_reseller_settings');
		register_hook('web:reseller:resellerinfo:table', 'mod_cband_get_infotable');
		register_hook('web:reseller:newdomain:table', 'mod_cband_domain_settings');
		
		register_hook('fetchdata:reseller:transfer', 'transfer_fetch');
		register_hook('fetchdata:reseller:bandwidth', 'bandwidth_fetch');
		register_hook('fetchdata:reseller:*', 'transfer_fetch');
		register_hook('fetchdata:reseller:*', 'bandwidth_fetch');
		register_hook('web:reseller:create', 'transfer_set');
		register_hook('web:reseller:create', 'bandwidth_set');
		register_hook('web:reseller:update', 'transfer_set');
		register_hook('web:reseller:update', 'bandwidth_set');
		register_hook('web:reseller:update:check', 'transfer_check');
		register_hook('web:reseller:update:check', 'bandwidth_check');
		
		register_hook('fetchdata:total:transfer', 'transfer_fetch_total');
		register_hook('fetchdata:total:*', 'transfer_fetch_total');
		register_hook('fetchdata:total:bandwidth', 'bandwidth_fetch_total');
		register_hook('fetchdata:total:*', 'bandwidth_fetch_total');
		register_hook('fetchdata:alloc:transfer', 'transfer_fetch_alloc');
		register_hook('fetchdata:alloc:*', 'transfer_fetch_alloc');
		register_hook('fetchdata:alloc:bandwidth', 'bandwidth_fetch_alloc');
		register_hook('fetchdata:alloc:*', 'bandwidth_fetch_alloc');
		
		register_hook('web:domain:domainset:table', 'mod_cband_domain_settings');
		register_hook('web:domain:domaininfo:table', 'mod_cband_get_infotable');
		register_hook('fetchdata:domain:transfer', 'transfer_fetch');
		register_hook('fetchdata:domain:bandwidth', 'bandwidth_fetch');
		register_hook('fetchdata:domain:*', 'transfer_fetch');
		register_hook('fetchdata:domain:*', 'bandwidth_fetch');
		register_hook('web:domain:create', 'transfer_set');
		register_hook('web:domain:create', 'bandwidth_set');
		register_hook('web:domain:create:check', 'transfer_domain_check');
		register_hook('web:domain:create:check', 'bandwidth_domain_check');
		register_hook('web:domain:update', 'transfer_set');
		register_hook('web:domain:update', 'bandwidth_set');
		register_hook('web:domain:update:check', 'transfer_domain_check');
		register_hook('web:domain:update:check', 'bandwidth_domain_check');
		
		register_hook('server:bwquota:check', 'mod_cband_quota_check');
		register_hook('server:bwquota:reset', 'mod_cband_quota_reset');
		register_hook('server:apache:virthost', 'mod_cband_generate_host_conf');
		register_hook('web:server:templates', 'mod_cband_template');
		register_hook('web:lang', 'mod_cband_add_lang');
		register_hook('web:cfg:default', 'mod_cband_add_cfg');
		register_hook('server:cfg:default', 'mod_cband_add_cfg');
		break;
}
?>